{include file="inc/header.html"}
<?php
$this->_var['dealcss'][] = $this->_var['TMPL_REAL']."/css/deal.css";
?>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$dealcss"}" />
<div class="pos f_yahei">
	<div class="pos_link f_yahei">
		<a href="{url x="index" r="deals"}">我要理财</a>  
		<span style="font-weight:bold;"> &gt;</span> 
		<a href="{url x="index" r="transfer"}">投资借款列表</a>
		<span style="font-weight:bold;"> &gt;</span> 
		<a>我要投标</a>
	</div>
</div>
<div class="clearfix bddf wb">
		<div class="bid-title  tc b f14 pt15 pb10 bb1">
			确认投标金额
		</div>
		<div class="blank"></div>
		<div class="clearfix" style="width:930px">
			<div class="b pt10 pb10 f14">确认借款信息</div>
			<table width="100%" cellpadding="0" cellspacing="0" class="bid-table">
				<tr>
					<td class="tit tr w100">借款标题：</td>
					<td>{$deal.name}</td>
				</tr>
				<tr>
					<td class="tit tr w100">借款金额：</td>
					<td class="f_red bg">{$deal.borrow_amount_format}</td>
				</tr>
				<tr>
					<td class="tit tr w100">借款年利率：</td>
					<td class="f_red">{function name="number_format" v=$deal.rate f=2} %</td>
				</tr>
				<tr>
					<td class="tit tr w100">借款期限：</td>
					<td class="f_red bg">{$deal.repay_time}{if $deal.repay_time_type eq 0}天{else}个月{/if}</td>
				</tr>
				<tr>
					<td class="tit tr w100">还款周期：</td>
					<td>按月还款</td>
				</tr>
				<tr>
					<td class="tit tr w100">还款方式：</td>
					<td>{if $deal.loantype eq 0}等额本息{elseif $deal.loantype eq 1}付息还本{elseif $deal.loantype eq 2}到期还本息{/if}</td>
				</tr>
				<tr>
					<td class="tit tr w100">已完成：</td>
					<td class="bg">
						<div class="blueProgressBar progressBar f_l" style="margin-top:16px">
	                        <div class="p">
	                        	<div class="c" style="width:{function name='round' val=$deal.progress_point f=3}%;"></div>
	                       	</div>
	                    </div>
						<div class="f_l pl5 pt5">{function name='round' val=$deal.progress_point}%</div>
					</td>
				</tr>
				<tr>
					<td class="tit tr btm w100">剩余投标金额：</td>
					<td class="f_red btm">{$deal.need_money}</td>
				</tr>
			</table>
			<div class="blank"></div>
			<table width="100%" cellpadding="0" cellspacing="0" class="bid-table">
				<tr>
					<td class="tit tr w100">我的可用余额：</td>
					<td class="f_red">
						{function name="format_price" v=$user_info.money}
						&nbsp;&nbsp;
						<a href="{url x="index" r="uc_money#incharge"}" target="_blank">我要充值</a>
					</td>
				</tr>
				<tr>
					<td class="tit tr w100 ">投标金额：</td>
					<td class="f_red bg ">
						<input class="f-input f-input90"  autocomplete="off" name="bid_money" id="J_BIDMONEY" /> 元&nbsp;&nbsp;<span class="f_dgray">(最低投标金额为{function name="round" v=$deal.min_loan_money f=2}元{if $deal.max_loan_money gt 0},最高投标金额为{function name="round" v=$deal.max_loan_money f=2}元{/if}{if (int)app_conf('DEAL_BID_MULTIPLE') gt 0},并且是{function name='app_conf' v='DEAL_BID_MULTIPLE'}的倍数{/if})</span>
						<input type="hidden" name="id" value="{$deal.id}" />
					</td>
				</tr>
				
				<tr>
					<td class="tit tr w100 btm">支付密码：</td>
					<td>
						<input type="password"  autocomplete="off" class="f-input  f-input90" name="bid_paypassword" id="J_PAYPASSWORD" autocomplete="off" />
						还未设置？<a href="{url x="index" r="uc_account#security"}" target="_blank" class='f_blue'>点这里</a>
					</td>
				</tr>
				
			</table>
		</div>
		<div class="blank20"></div>
		<div class="blank20"></div>
		<div class="clearfix bbd bid_act_box">
			<input  type="button" class="bid_submit_button mt20" id="J_bid_submit" value="确认投标" />
		</div>
</div>
<script type="text/javascript">
	var is_submit_lock =false;
	jQuery(function(){
		$("#J_bid_submit").click(function(){
			if(is_submit_lock)
			{
				return false;
			}
			is_submit_lock = true;
			if($.trim($("#J_BIDMONEY").val())=="" || !$.checkNumber($("#J_BIDMONEY").val()){if (int)app_conf('DEAL_BID_MULTIPLE') gt 0} || parseFloat($("#J_BIDMONEY").val())%{function name='app_conf' v='DEAL_BID_MULTIPLE'}!=0{/if} || parseFloat($("#J_BIDMONEY").val())<=0 || parseFloat($("#J_BIDMONEY").val())<{$deal.min_loan_money} {if $deal.max_loan_money gt 0}|| parseFloat($("#J_BIDMONEY").val())>{$deal.max_loan_money}{/if}){
				is_submit_lock = false;
				$.showErr(LANG.BID_MONEY_NOT_TRUE,function(){
					$("#J_BIDMONEY").focus();
				});
				return false;
			}
			var query = new Object();
			query.bid_money=$("#J_BIDMONEY").val();
			query.id=$(".bid-table input[name='id']").val();
			query.bid_paypassword = $("#J_PAYPASSWORD").val();
			
			
			$.ajax({
				url:APP_ROOT + "/index.php?ctl=deal&act=dobid&ajax=1",
				data:query,
				type:"POST",
				dataType:"json",
				success:function(result){
					if(result.status==1){
						is_submit_lock = false;
						$.showSuccess(result.info,function(){
							window.location.href=result.jump;
						});
					}
					else if(result.status==2){
						window.location.href=result.jump;
					}
					else{
						is_submit_lock = false;
						$.showErr(result.info);
					}
				},
				error:function(ajaxobj)
				{
		//			if(ajaxobj.responseText!='')
		//			alert(ajaxobj.responseText);
				}
			});
			return false;
		});
	});
</script>
{include file="inc/footer.html"}